package cn.com.xyc.datasource.pojo;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

public class UserMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet arg0, int arg1) throws SQLException {
		User user = new User();
		user.setId(arg0.getInt("id"));
		user.setEmail(arg0.getString("email"));
		user.setNickname(arg0.getString("nickname"));

		if (arg0.getString("is_email_verify").equals("Y")) {
			user.setEmailVerify(true);
		} else {
			user.setEmailVerify(false);
		}

		user.setEmailVerifyCode(arg0.getString("email_verify_code"));
		user.setLastLoginTime(arg0.getLong("last_login_time"));
		return user;
	}

}
